package com.yugao.fintech.draper.admin.controller;

import com.yugao.fintech.draper.core.model.ResultVO;
import com.yugao.fintech.draper.security.annotation.SecurityInner;
import com.yugao.fintech.draper.sms.service.AliyunSmsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/sms")
@RequiredArgsConstructor
@Tag(name = "短信管理")
public class SmsController {
	private final AliyunSmsService aliyunSmsService;

	@Operation(summary = "发送短信")
	@SecurityInner
	@GetMapping("/sendSms")
	public <T> ResultVO<T> sendSmsCode(String phoneNumber) {
		return (ResultVO<T>) ResultVO.success(aliyunSmsService.sendSmsCode(phoneNumber));
	}
}
